import { Toast } from 'vant';
import { Dialog } from 'vant';
export default {
    /**
     * 加载提示框
     * @param {*} msg 
     */
    showLoading(msg) {
        let tips = "";
        if (msg) {
            tips = msg;
        }
        Toast.loading({
            duration: 0,
            message: tips,
            forbidClick: true
        });
    },
    /**
     * 关闭加载提示
     */
    hideLoading() {
        Toast.clear();
    },
    /**
     * 
     * @param {*} obj{title,msg,close()} 
     */
    dialog(obj) {
        let mTitile = "提示信息";
        if (obj.title) {
            mTitile = obj.title;
        }
        Dialog.alert({
            title: mTitile,
            message: obj.msg
        }).then(() => {
            // on close
            obj.close();
        });
    }
}